# coding = utf-8


import re

import urllib.request


def get_prod():

    url = "http://www.cert.org.cn"

    headers = ('User-Agent','Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0')

    opener = urllib.request.build_opener()

    opener.addheaders=[headers]

    data = str(opener.open(url).read(),'utf-8')

    print(data)


    pattern = re.compile('<li><span>(\d{4}-\d{2}-\d{2})</span><a href="/publish/main/\d+/\d+/\d+/\d+_.html" target=\S+>(.*)</a></li>')

    items = re.findall(pattern,data)

    print(items)

if __name__=='__main__':

    get_prod()